package responseModels

var Code ICodeMessage = CreateICodeMessage()

type Response struct {
	CodeMessage
	Data interface{} `json:"data"`
}

func (response *Response) IsLoginErr(msg string) Response {
	return Response{
		Code.IsLoginErr(msg),
		nil,
	}
}

func (response *Response) FORBIDDEN(msg string) Response {
	return Response{
		Code.FORBIDDEN(msg),
		nil,
	}
}

func (response *Response) IsvalidatedError(msg string) Response {
	return Response{
		Code.ISVALIDATED(msg),
		nil,
	}
}

func (response *Response) OK(data interface{}) Response {
	Code.OK()
	return Response{
		Code.OK(),
		data,
	}
}

func (response *Response) ERROR() Response {
	return Response{
		Code.ERROR(),
		nil,
	}
}

func (response *Response) DEVELOP() Response {
	return Response{
		Code.DEVELOP(),
		nil,
	}
}
